﻿<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build"
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <MsiFilePath>$(OutDir)\$(LocaleToBuild)\$(OutputName).msi</MsiFilePath>
  </PropertyGroup>

  <ItemGroup>
    <EmbeddedResources Include="$(MsiFilePath)" />
  </ItemGroup>
  
  <Target Name="BeforeBuild"
          Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">

    <!-- Copy the latest MSI and the file referenced as an embedded resource in the Project -->
    <Copy SourceFiles="@(EmbeddedResources)"
          DestinationFiles="@(EmbeddedResources->'$(ProjectDir)EmbeddedResources\ScrumForTeamSystem.msi')"
          SkipUnchangedFiles="false"          
    />
    
  </Target>

  
  <Target Name="AfterBuild">

    <!-- Sign the Bootstrapper -->
    <Exec Condition=" '$(TeamBuildConstants)' == '_TEAM_BUILD_' AND '$(IsDesktopBuild)' != 'true' "
          Command="&quot;$(ProjectDir)..\..\..\..\Build\Tools\SignTool.exe&quot; sign /n &quot;EMC Corporation&quot; /a /d &quot;Scrum for Team System&quot; /du &quot;http://www.ScrumForTeamSystem.com&quot; /t &quot;http://timestamp.verisign.com/scripts/timstamp.dll&quot; &quot;$(TargetPath)&quot;"
    />

  </Target>
  
</Project>